package com.showT.service.impl;

import com.showT.dao.IUsersDao;
import com.showT.domain.Users;
import com.showT.service.IUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UsersServiceImpl implements IUsersService {

    @Autowired
    private IUsersDao usersDao;

    @Override
    public void save(Users users) {
        usersDao.save(users);
    }

    @Override
    public Users findByUsername(String username) {
        return usersDao.findByUsername(username);
    }

   /* @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        Users users = usersDao.findByUsername(username);

        List<GrantedAuthority> authority = new ArrayList<>();

        authority.add(new SimpleGrantedAuthority("ROLE_USER"));

        User user = new User(username,users.getPassword(),authority);

        return user;
    }*/
}
